import java.io.*;
import java.sql.*;
import java.util.Vector;

import javax.servlet.*;
import javax.servlet.http.*;

import nanuk.NanukUser;
import nanuk.*;
// This class will return the users in proximity to the user with given login id.
public class sendInvitation extends HttpServlet{
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/plain");
		PrintWriter pw = response.getWriter();
		String login = request.getParameter("login");
		String credentials = request.getParameter("credentials");
		String inviteeLogin = request.getParameter("inviteeLogin");
		
		try{
			
			NanukServer server = new NanukServer();
			server.invite(login, credentials, inviteeLogin);
			
			
		}catch(Exception e){
			pw.println("exception "+e.getMessage());
		}
		
	}


private class NanukServer extends NanukShareServer{

	public String appID = "61";
	public String appCredentials = "-390607be4eccc1be6ae7780dce75de33fceeb12c1f7847807b2dba41948f438";

	public String getApplicationCredentials() {
		return appCredentials;  		// change to secret set at application registration	
	}

	public String getApplicationID() {
		return appID;				// change to ID given at application registration 
	}


}}
